package com.cow.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cow.mapper.OrderGoodMapper;
import com.cow.pojo.OrderGood;
import com.cow.pojo.OrderGoodExample;
import com.cow.service.OrderGoodService;

/** 
* @author 光环and鬼泣
* @version 2018年6月8日 上午9:35:45
*/
@Service("orderGoodService")
public class OrderGoodServiceImpl implements OrderGoodService {

	@Autowired
	private OrderGoodMapper orderGoodMapper;
	
	@Override
	public List<OrderGood> getOrderGoodList(String OrderId) throws Exception {
		OrderGoodExample example = new OrderGoodExample();
		OrderGoodExample.Criteria criteria = example.createCriteria();
		criteria.andOrderIdEqualTo(OrderId);
		List<OrderGood> orderGoodList = orderGoodMapper.selectByExample(example);
		return orderGoodList;
	}

	@Override
	public int insertOrderGood(OrderGood orderGood) throws Exception {
		int result = orderGoodMapper.insert(orderGood);
		return result;
	}

}
